package gecko.control;

import java.awt.Window;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;
import java.awt.event.MouseEvent;
import java.awt.event.MouseListener;
import java.beans.PropertyChangeEvent;
import java.beans.PropertyChangeListener;
import java.sql.SQLException;

import javax.swing.JTable;
import javax.swing.event.TableModelEvent;
import javax.swing.text.TabableView;

import gecko.model.ImporterPDF;
import gecko.model.Requete;
import gecko.view.IObservable;
import gecko.view.swing.VAdmin;
import gecko.view.swing.VLogin;
import gecko.view.swing.VParam;
import gecko.view.swing.VUser;
import gecko.view.swing.ALERTES.VAlerte;
import gecko.view.swing.ALERTES.VAlerteUser;
import gecko.view.swing.GESTION.VGestionAjoutUser;
import gecko.view.swing.GESTION.VGestionArchive;
import gecko.view.swing.GESTION.VGestion;
import gecko.view.swing.GESTION.VGestionAjout;
import gecko.view.swing.GESTION.VGestionArchiveUser;
import gecko.view.swing.GESTION.VGestionModification;
import gecko.view.swing.GESTION.VGestionModificationUser;
import gecko.view.swing.GESTION.VGestionUser;
import gecko.view.swing.PARAMETRES.VParamFournisseur;
import gecko.view.swing.PARAMETRES.VParamFournisseurAjout;
import gecko.view.swing.PARAMETRES.VParamFournisseurModif;
import gecko.view.swing.PARAMETRES.VParamService;
import gecko.view.swing.PARAMETRES.VParamServiceAjout;
import gecko.view.swing.PARAMETRES.VParamServiceModif;
import gecko.view.swing.PARAMETRES.VParamTypo;
import gecko.view.swing.PARAMETRES.VParamTypoAjout;
import gecko.view.swing.PARAMETRES.VParamTypoModif;
import gecko.view.swing.PARAMETRES.VParamUtilisateur;
import gecko.view.swing.PARAMETRES.VParamUtilisateurAjout;
import gecko.view.swing.PARAMETRES.VParamUtilisateurModif;
import gecko.view.swing.RECHERCHE.VRecherche;
import gecko.view.swing.RECHERCHE.VRechercheReponse;
import gecko.view.swing.RECHERCHE.VRechercheUser;

public class CtrlGecko implements ActionListener, MouseListener {
	private IObservable vue;

	
	public void setVue(IObservable vue) {
		this.vue = vue;
	}
	
	public IObservable getVue(){
		return vue;
	}
	
	public void lancerApp(){
		vue = new VLogin(this);
		this.setVue(vue);
	}
	private Requete requete;

	@Override
	public void mouseClicked(MouseEvent arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mouseEntered(MouseEvent arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mouseExited(MouseEvent arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mousePressed(MouseEvent arg0) {
		// TODO Auto-generated method stub

	}

	@Override
	public void mouseReleased(MouseEvent arg0) {
		// TODO Auto-generated method stub

	}

	public void actionPerformed(ActionEvent ae) {
		String s = ae.getActionCommand();
		Requete r = new Requete();
		

		if (s.equals("OK_Login")) {
			String userSaisie = getVue().getUtilisateur();
			String mdpSaisie = getVue().getUtilisateur();
			
			try {
				
				 if(r.verifAdmin(userSaisie) && r.verifmdp(mdpSaisie))
				{
					((Window) this.getVue()).setVisible(false);
					IObservable admin = new VAdmin(this, true);
					this.setVue(admin);

				}
				else if(r.verifUser(userSaisie) && r.verifmdp(mdpSaisie))
				{
					((Window) this.getVue()).setVisible(false);
					IObservable user = new VUser(this, true);
					this.setVue(user);
				} 
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
		} else if (s.equals("GESTION")) {
			((Window) this.getVue()).setVisible(false);
			IObservable gestion = new VGestion(this);
			this.setVue(gestion);
		} else if (s.equals("GESTION_USER")) {
			((Window) this.getVue()).setVisible(false);
			IObservable gestion = new VGestionUser(this);
			this.setVue(gestion);
		} else if (s.equals("ALERTE")) {
			((Window) this.getVue()).setVisible(false);
			IObservable alerte = null;
			try {
				alerte = new VAlerte();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(alerte);
		} else if (s.equals("RECHERCHE")) {
			((Window) this.getVue()).setVisible(false);
			IObservable recherche = null;
			try {
				recherche = new VRecherche();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(recherche);
		}else if (s.equals("RECHERCHER_REPONSE")) {
			((Window) this.getVue()).setVisible(false);
			IObservable reponse = null;
			try {
				VRecherche recherche = (VRecherche) this.vue;
				String fournisseur = recherche.getFourn();
				boolean actif = recherche.getActif();
				String typo = recherche.getTypo();
				String serv = recherche.getService();
				reponse = new VRechercheReponse( typo, fournisseur, serv, actif);
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(reponse);
		} else if (s.equals("PARAMETRE")) {
			((Window) this.getVue()).setVisible(false);
			IObservable parametre = new VParam();
			this.setVue(parametre);
		} else if (s.equals("DECONNEXION")) {
			((Window) this.getVue()).setVisible(false);
			IObservable login = new VLogin(this);
			this.setVue(login);
		} else if (s.equals("SERVICE")) {
			((Window) this.getVue()).setVisible(false);
			IObservable service = null;
			try {
				service = new VParamService();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(service);
		} else if (s.equals("UTILISATEUR")) {
			((Window) this.getVue()).setVisible(false);
			IObservable utilisateur = null;
			try {
				utilisateur = new VParamUtilisateur();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(utilisateur);
		} else if (s.equals("TYPOLOGIE")) {
			((Window) this.getVue()).setVisible(false);
			IObservable typo = null;
			try {
				typo = new VParamTypo();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(typo);
		} else if (s.equals("FOURNISSEUR")) {
			((Window) this.getVue()).setVisible(false);
			IObservable fournisseur = null;
			try {
				fournisseur = new VParamFournisseur();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(fournisseur);
		} else if (s.equals("AJOUT_CONTRAT")) {
			((Window) this.getVue()).setVisible(false);
			IObservable gestion_ajout = null;
			try {
				gestion_ajout = new VGestionAjout();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(gestion_ajout);
		} else if (s.equals("MODIFICATION_CONTRAT")) {
			((Window) this.getVue()).setVisible(false);
			IObservable gestion_modif = null;
			try {
				gestion_modif = new VGestionModification();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(gestion_modif);
		} else if (s.equals("ARCHIVE")) {
			((Window) this.getVue()).setVisible(false);
			IObservable archive = null;
			try {
				archive = new VGestionArchive();
			} catch (SQLException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			this.setVue(archive);
		} else if (s.equals("AJOUT_SERVICE")) {
			((Window) this.getVue()).setVisible(false);
			IObservable ajout_service = new VParamServiceAjout();
			this.setVue(ajout_service);
		} else if (s.equals("MODIFICATION_SERVICE")) {
			((Window) this.getVue()).setVisible(false);
			IObservable modif_service = null;
			try {
				modif_service = new VParamServiceModif();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(modif_service);
		} else if (s.equals("AJOUT_UTILISATEUR")) {
			((Window) this.getVue()).setVisible(false);
			IObservable ajout_utilisateur = null;
			try {
				ajout_utilisateur = new VParamUtilisateurAjout();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(ajout_utilisateur);
		} else if (s.equals("MODIFICATION_UTILISATEUR")) {
			((Window) this.getVue()).setVisible(false);
			IObservable modif_utilisateur = null;
			try {
				modif_utilisateur = new VParamUtilisateurModif();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(modif_utilisateur);
		} else if (s.equals("AJOUT_TYPO")) {
			((Window) this.getVue()).setVisible(false);
			IObservable ajout_typo = new VParamTypoAjout();
			this.setVue(ajout_typo);
		} else if (s.equals("MODIFICATION_TYPO")) {
			((Window) this.getVue()).setVisible(false);
			IObservable modif_typo = null;
			try {
				modif_typo = new VParamTypoModif();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(modif_typo);
		} else if (s.equals("AJOUT_FOURNISSEUR")) {
			((Window) this.getVue()).setVisible(false);
			IObservable ajout_fourn = new VParamFournisseurAjout();
			this.setVue(ajout_fourn);
		} else if (s.equals("MODIFICATION_FOURNISSEUR")) {
			((Window) this.getVue()).setVisible(false);
			IObservable modif_fourn = null;
			try {
				modif_fourn = new VParamFournisseurModif();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(modif_fourn);
		} else if (s.equals("ALERTE_USER")) {
			((Window) this.getVue()).setVisible(false);
			IObservable alerte = null;
			try {
				alerte = new VAlerteUser();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(alerte);
		} else if (s.equals("RECHERCHE_USER")) {
			((Window) this.getVue()).setVisible(false);
			IObservable recherche = null;
			try {
				recherche = new VRechercheUser();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(recherche);
		} else if (s.equals("AJOUT_CONTRAT_USER")) {
			((Window) this.getVue()).setVisible(false);
			IObservable gestion_ajout = null;
			try {
				gestion_ajout = new VGestionAjoutUser();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(gestion_ajout);
		} else if (s.equals("MODIFICATION_CONTRAT_USER")) {
			((Window) this.getVue()).setVisible(false);
			IObservable gestion_modif = null;
			try {
				gestion_modif = new VGestionModificationUser();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(gestion_modif);
		} else if (s.equals("ARCHIVE_USER")) {
			((Window) this.getVue()).setVisible(false);
			IObservable archive = null;
			try {
				archive = new VGestionArchiveUser();
			} catch (SQLException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			this.setVue(archive);
			
		} else if(s.equals("IMPORTER_CONTRAT")) {
			ImporterPDF.importer();
		} else if (s.equals("ENREGISTRER_CONTRAT")) {
			((Window) this.getVue()).setVisible(false);
			try {
				String Service = getVue().getIDServ();
				String resultService = r.recupService(Service);
				String Fourn = getVue().getIDFourn();
				String resultFourn = r.recupFourn(Fourn);
				String Typo = getVue().getIDTypo();
				String resultTypo = r.recupTypo(Typo);
				String resultDelai = getVue().getDelai();
				String resultSign = getVue().getSaisieSign();
				String resultJour = getVue().getJour();
				String resultJourFin = getVue().getJourFin();
				String resultMois = getVue().getMois();
				String resultMoisFin = getVue().getMoisFin();
				String resultAnnee = getVue().getAnnee();
				String resultAnneeFin = getVue().getAnneeFin();
				String resultDate = (resultAnnee+"-"+resultMois+"-"+resultJour);
				String resultFin = (resultAnneeFin+"-"+resultMoisFin+"-"+resultJourFin);
				String resultLibelle = getVue().getSaisieLib();
				String resultUrl = ImporterPDF.getUrl();
				r.ajoutContrat(resultService, resultFourn, resultTypo, resultDelai, resultSign, resultDate, resultFin, resultLibelle, resultUrl);
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			IObservable gestion = null;
			gestion = new VGestion(this);
			this.setVue(gestion);
		} else if (s.equals("MODIFIER_CONTRAT")) {
			((Window) this.getVue()).setVisible(false);
			try {
				String resultContrat = getVue().getIDContrat();
				String Service = getVue().getIDServ();
				String resultService = r.recupService(Service);
				String Fourn = getVue().getIDFourn();
				String resultFourn = r.recupFourn(Fourn);
				String Typo = getVue().getIDTypo();
				String resultTypo = r.recupTypo(Typo);
				String resultDelai = getVue().getDelai();
				String resultSign = getVue().getSaisieSign();
				String resultJour = getVue().getJour();
				String resultJourFin = getVue().getJourFin();
				String resultMois = getVue().getMois();
				String resultMoisFin = getVue().getMoisFin();
				String resultAnnee = getVue().getAnnee();
				String resultAnneeFin = getVue().getAnneeFin();
				String resultDate = (resultAnnee+"-"+resultMois+"-"+resultJour);
				String resultFin = (resultAnneeFin+"-"+resultMoisFin+"-"+resultJourFin);
				String resultLibelle = getVue().getSaisieLib();
				String resultUrl = ImporterPDF.getUrl();
				r.modifContrat(resultContrat, resultService, resultFourn, resultTypo, resultDelai, resultSign, resultDate, resultFin, resultLibelle, resultUrl);
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			IObservable gestion = null;
			gestion = new VGestion(this);
			this.setVue(gestion);
		} else if(s.equals("ANNULER_CONTRAT")){
			((Window) this.getVue()).setVisible(false);
			IObservable gestion = null;
			gestion = new VGestion(this);
			this.setVue(gestion);
		} else if (s.equals("ENREGISTRER_CONTRAT_USER")) {
			((Window) this.getVue()).setVisible(false);
			try {
				String Service = getVue().getIDServ();
				String resultService = r.recupService(Service);
				String Fourn = getVue().getIDFourn();
				String resultFourn = r.recupFourn(Fourn);
				String Typo = getVue().getIDTypo();
				String resultTypo = r.recupTypo(Typo);
				String resultDelai = getVue().getDelai();
				String resultSign = getVue().getSaisieSign();
				String resultJour = getVue().getJour();
				String resultJourFin = getVue().getJourFin();
				String resultMois = getVue().getMois();
				String resultMoisFin = getVue().getMoisFin();
				String resultAnnee = getVue().getAnnee();
				String resultAnneeFin = getVue().getAnneeFin();
				String resultDate = (resultAnnee+"-"+resultMois+"-"+resultJour);
				String resultFin = (resultAnneeFin+"-"+resultMoisFin+"-"+resultJourFin);
				String resultLibelle = getVue().getSaisieLib();
				String resultUrl = ImporterPDF.getUrl();
				r.ajoutContrat(resultService, resultFourn, resultTypo, resultDelai, resultSign, resultDate, resultFin, resultLibelle, resultUrl);
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			IObservable gestion = null;
			gestion = new VGestionUser(this);
			this.setVue(gestion);
		} else if (s.equals("MODIFIER_CONTRAT_USER")) {
			((Window) this.getVue()).setVisible(false);
			try {
				String resultContrat = getVue().getIDContrat();
				String Service = getVue().getIDServ();
				String resultService = r.recupService(Service);
				String Fourn = getVue().getIDFourn();
				String resultFourn = r.recupFourn(Fourn);
				String Typo = getVue().getIDTypo();
				String resultTypo = r.recupTypo(Typo);
				String resultDelai = getVue().getDelai();
				String resultSign = getVue().getSaisieSign();
				String resultJour = getVue().getJour();
				String resultJourFin = getVue().getJourFin();
				String resultMois = getVue().getMois();
				String resultMoisFin = getVue().getMoisFin();
				String resultAnnee = getVue().getAnnee();
				String resultAnneeFin = getVue().getAnneeFin();
				String resultDate = (resultAnnee+"-"+resultMois+"-"+resultJour);
				String resultFin = (resultAnneeFin+"-"+resultMoisFin+"-"+resultJourFin);
				String resultLibelle = getVue().getSaisieLib();
				String resultUrl = ImporterPDF.getUrl();
				r.modifContrat(resultContrat, resultService, resultFourn, resultTypo, resultDelai, resultSign, resultDate, resultFin, resultLibelle, resultUrl);
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			IObservable gestion = null;
			gestion = new VGestionUser(this);
			this.setVue(gestion);
		} else if(s.equals("ANNULER_CONTRAT_USER")){
			((Window) this.getVue()).setVisible(false);
			IObservable gestion = null;
			gestion = new VGestionUser(this);
			this.setVue(gestion);
		} else if (s.equals("ENREGISTRER_SERVICE_AJOUT")) {
			((Window) this.getVue()).setVisible(false);
			try {
				String resultSaisie = getVue().getSaisieService();
				r.ajoutService(resultSaisie);
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			IObservable service = null;
			try {
				service = new VParamService();
			} catch (SQLException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			this.setVue(service);
		} else if (s.equals("ENREGISTRER_SERVICE_MODIF")) {
			((Window) this.getVue()).setVisible(false);
			try {
				String resultSaisie = getVue().getSaisieService();
				String idServ = getVue().getIDServ();
				r.modifService(resultSaisie, idServ);
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			IObservable service = null;
			try {
				service = new VParamService();
			} catch (SQLException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			this.setVue(service);
		} else if (s.equals("ENREGISTRER_FOURNISSEUR_AJOUT")) {
			((Window) this.getVue()).setVisible(false);
			try {
				String resultNomFourn = getVue().getSaisieNom();
				String resultNumeroFourn = getVue().getSaisieNumero();
				String resultRueFourn = getVue().getSaisieRue();
				String resultCPFourn = getVue().getSaisieCP();
				String resultVilleFourn = getVue().getSaisieVille();
				r.ajoutFournisseur(resultNomFourn, resultNumeroFourn, resultRueFourn, resultCPFourn, resultVilleFourn);
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			IObservable service = null;
			try {
				service = new VParamFournisseur();
			} catch (SQLException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			this.setVue(service);
		} else if (s.equals("ENREGISTRER_FOURNISSEUR_MODIF")) {
			((Window) this.getVue()).setVisible(false);
			String resultNomFourn = getVue().getSaisieNom();
			String resultNumeroFourn = getVue().getSaisieNumero();
			String resultRueFourn = getVue().getSaisieRue();
			String resultCPFourn = getVue().getSaisieCP();
			String resultVilleFourn = getVue().getSaisieVille();
			String idFourn = getVue().getIDFourn();
			//r.modifFournisseur(idFourn, resultNomFourn, resultNumeroFourn, resultRueFourn, resultCPFourn, resultVilleFourn);
			IObservable service = null;
			try {
				service = new VParamFournisseur();
			} catch (SQLException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			this.setVue(service);
		} else if (s.equals("ENREGISTRER_TYPO_AJOUT")) {
			((Window) this.getVue()).setVisible(false);
			try {
				String resultSaisieTypo = getVue().getSaisieTypo();
				r.ajoutTypo(resultSaisieTypo);
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			IObservable service = null;
			try {
				service = new VParamTypo();
			} catch (SQLException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			this.setVue(service);
		} else if (s.equals("ENREGISTRER_TYPO_MODIF")) {
			((Window) this.getVue()).setVisible(false);
			try {
				String resultSaisie = getVue().getSaisieTypo();
				String idTypo = getVue().getIDTypo();
				r.modifTypo(resultSaisie, idTypo);
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			IObservable service = null;
			try {
				service = new VParamTypo();
			} catch (SQLException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			this.setVue(service);
			
			
		}  else if (s.equals("ENREGISTRER_UTILISATEUR_AJOUT")) {
			((Window) this.getVue()).setVisible(false);
			String resultSaisieNom = getVue().getSaisieNom();
			String resultSaisiePrenom = ((VParamUtilisateurAjout) getVue()).getSaisiePrenom();
			String resultSaisieFonction = ((VParamUtilisateurAjout) getVue()).getSaisieFonction();
			String resultSaisieMdp = ((VParamUtilisateurAjout) getVue()).getSaisieMdp();
			IObservable service = null;
			try {
				service = new  VParamUtilisateur();
			} catch (SQLException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			this.setVue(service);
		} else if (s.equals("ENREGISTRER_UTILISATEUR_MODIF")) {
			((Window) this.getVue()).setVisible(false);
			String resultSaisieNom = getVue().getSaisieNom();
			String resultSaisiePrenom = ((VParamUtilisateurModif) getVue()).getSaisiePrenom();
			String resultSaisieFonction = ((VParamUtilisateurModif) getVue()).getSaisieFonction();
			String resultSaisieMdp = ((VParamUtilisateurModif) getVue()).getSaisieMdp();
			//r.modifUtilisateur(resultSaisieNom, resultSaisiePrenom, resultSaisieFonction, resultSaisieMdp);
			IObservable service = null;
			try {
				service = new VParamUtilisateur();
			} catch (SQLException e1) {
				// TODO Auto-generated catch block
				e1.printStackTrace();
			}
			this.setVue(service);
		} else if(s.equals("ANNULER_SERVICE")){
			((Window) this.getVue()).setVisible(false);
			IObservable params = null;
			try {
				params = new VParamService();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(params);
		} else if(s.equals("ANNULER_FOURNISSEUR")){
			((Window) this.getVue()).setVisible(false);
			IObservable params = null;
			try {
				params = new VParamFournisseur();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(params);
		} else if(s.equals("ANNULER_TYPO")){
			((Window) this.getVue()).setVisible(false);
			IObservable params = null;
			try {
				params = new VParamTypo();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(params);
		} else if(s.equals("ANNULER_UTILISATEUR")){
			((Window) this.getVue()).setVisible(false);
			IObservable params = null;
			try {
				params = new VParamUtilisateur();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(params);
		} 
		
		
		
		if (s.equals("Annuler_Alerte")) {
			try {
				System.out.println(this.vue.getTab().getValueAt(0, 10));
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			//r.annulerAlerte(value);
		}
		
		if (s.equals("Enregistrer_Alerte")) {
			((Window) this.getVue()).setVisible(false);
			IObservable alerte = null;
			try {
				alerte = new VAlerte();
			} catch (SQLException e) {
				// TODO Auto-generated catch block
				e.printStackTrace();
			}
			this.setVue(alerte);
		}
	}
	
	
	public Requete getRequete() {
		return requete;
	}
}
